home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 43 / Mac Magazin and MacEasy Magazine CD - Issue 43.iso / Software / Entwickler / ListBox 0.4 / main.cpp < prev   
Text File  |  1998-02-15  |  1KB  |  57 lines

  1.  
  2. #include "ListBox.h"
  3.  
  4. void INIT(unsigned char i)
  5. {
  6. InitGraf(&qd.thePort);
  7. InitFonts();
  8. InitWindows();
  9. InitMenus();
  10. TEInit();
  11. InitDialogs(nil);
  12. InitCursor();
  13. FlushEvents(everyEvent,0);
  14. MaxApplZone();
  15. while (i--)
  16.     MoreMasters();
  17. }
  18.  
  19.  
  20.  
  21. void main (void) {
  22. DialogPtr    theDialog;
  23. short        itemHit, returnVal;
  24.  
  25. INIT(3);
  26.  
  27. theDialog = GetNewDialog(128, nil, (WindowPtr)-1);
  28. SetPort(theDialog);
  29.  
  30. ListBox        myList;
  31.  
  32. myList.SetupFromItem(theDialog, 2);
  33.  
  34. myList.AddItem(1, "\pHi there!!!");                //Line 0, id 1
  35. myList.AddItem(3, "\pThis Is ListBox.");        //Line 1, id 3
  36. myList.AddItem(5, "\pFor the MacOS ListManager... You got a problem with that?");    //Line 2, id 5 
  37. myList.AddItem(7, "\pAn ease to use replacement...");    //Line 3, id 7
  38. myList.AddItem(11, "\pby Kyle Ellrott");        //Line 4, id 11
  39. myList.AddItem(13, "\pKyle Ellrott is a dork");    //Line 5, id 13
  40.  
  41. myList.KillLine(5);
  42. myList.SwapLines(2,3);
  43.  
  44. myList.AddItem(6, "\p");
  45. myList.AddItem(7, "\pThe following are resources");
  46. myList.MakeResTypeList('Test');
  47.  
  48. do {
  49.     myList.ModalDialog(nil, &itemHit);
  50. } while (itemHit != 1);
  51.  
  52. returnVal = myList.GetCurItem();
  53.  
  54. myList.Close();
  55. CloseWindow(theDialog);
  56.  
  57. }